Add WebDav tests#17
Merged
Menelion merged 33 commits intoJan 5, 2026
Merged
Conversation
- Created WebDavStorageTests.cs with 43 test methods (771 lines) - 20 unit tests covering constructors, authentication, and properties - 23 integration tests covering all CRUD operations - Full OAuth2 authentication flow testing with mock provider - Tests for basic auth, file operations, directories, metadata - Progress event testing for large file uploads/downloads - Server capabilities detection testing - Follows same patterns as existing SFTP/FTP/S3 storage tests - Integration tests configurable via environment variables This addresses the critical v1.0 requirement for WebDAV test coverage.
- Added webdav service to docker-compose.test.yml (bytemark/webdav) - Added webdav service to GitHub Actions CI workflow - Updated run-integration-tests.sh with WebDAV health checks and env vars - Updated run-integration-tests.ps1 with WebDAV health checks and env vars - Set WEBDAV_TEST_URL, WEBDAV_TEST_USER, WEBDAV_TEST_PASS environment variables - WebDAV server runs on port 8080 with basic auth (testuser/testpass) This enables the 23 WebDAV integration tests to run in CI alongside SFTP, FTP, and S3 tests.
- Changed USERNAME/PASSWORD to WEBDAV_USERNAME/WEBDAV_PASSWORD - Added --health-start-period 30s to allow Apache to fully start - Increased health check retries from 5 to 10 - Applied fixes to both GitHub Actions workflow and docker-compose The bytemark/webdav image needs time for Apache to initialize before health checks succeed. These changes resolve the container startup failures in CI.
Change WEBDAV_USERNAME/WEBDAV_PASSWORD to WEBDAV_USER/WEBDAV_PASS as expected by bytemark/webdav image. This should resolve the health check failures where Basic auth was not being configured properly.
- Add -L flag to curl to follow HTTP redirects (302 -> 200) - Increase health-retries from 10 to 20 for more resilience - Increase health-start-period from 30s to 60s for slower startups - Applied to both GitHub Actions workflow and docker-compose The bytemark/webdav container may return 302 redirects at startup, which caused health checks to fail without the -L flag.
- Changed health check to accept both HTTP 200 (OK) and 401 (auth required) - Container may return 401 during startup before auth is fully configured - Increased health-timeout from 5s to 10s - Increased health-start-period from 60s to 120s for slower initialization - Health check now extracts HTTP status code and validates with grep The bytemark/webdav container returns 401 during startup even though Apache is running, causing curl -f to fail. This fix treats both 200 and 401 as healthy states.
- Removed complex status code checking with grep - Health check now just verifies Apache responds (any status) - Increased retries from 20 to 30 - Increased start_period from 120s to 180s (3 minutes) - Removed credentials from health check (not needed) The previous health check was too strict. Apache ServerName warnings are harmless. This simple check just verifies the web server is up and responding.
Replace bytemark/webdav with maltokyo/docker-nginx-webdav: - Nginx-based, much lighter and faster to start - bytemark/webdav was taking 9+ minutes to start - Reduced health check start_period from 180s to 10s - Reduced retries from 30 to 5 - Changed env vars to WEBDAV_USERNAME/WEBDAV_PASSWORD - Should start in seconds instead of minutes This will significantly reduce CI time and GitHub Actions minutes usage.
- Changed WEBDAV_USERNAME/WEBDAV_PASSWORD to USERNAME/PASSWORD - Changed volume mount from /var/lib/dav to /media/data - These match the actual maltokyo/docker-nginx-webdav image configuration
- Changed health-cmd from curl to 'pgrep nginx' - curl may not be installed in maltokyo/docker-nginx-webdav image - pgrep checks for running nginx process directly - Increased start_period from 10s to 30s for safer startup - Increased retries from 5 to 6 - Increased interval from 5s to 10s This should resolve the container health check failures.
- Changed health-cmd to 'nc -z localhost 80' (port check) - Increased start_period from 30s to 60s - Increased retries from 6 to 10 - Added diagnostic logging step to capture container logs on failure - This will help us see why nginx isn't starting If this still fails, we'll need to switch to a different WebDAV image.
f6a2212 to
6ccc3c9
Compare
- Modified CreateDirectoryAsync to create parent directories before subdirectories - Added proper path normalization and empty path handling - Fixed issue where MKCOL was failing with 409 Conflict when parent didn't exist - Added StringSplitOptions.RemoveEmptyEntries to handle edge cases - Removed unnecessary 409 status code check as it indicates parent doesn't exist This fixes the failing CI tests that expected parent directories to be created automatically. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced error handling in CreateDirectoryAsync to better handle server responses - Added specific handling for 201 (Created), 405 (Method Not Allowed), and 409 (Conflict) status codes - Improved PROPFIND checks to verify resources are actually collections - Fixed GetFullPath to ensure consistent URL formatting without double slashes - Updated ExistsAsync to handle exceptions gracefully and check for 404 status - Added better error messages with status codes and descriptions These changes address the "MKCOL can create a collection only" errors seen in CI by being more explicit about handling various WebDAV server responses. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Switched from maltokyo/docker-nginx-webdav to ugeek/webdav:alpine-ng for better reliability - Added proper container initialization steps before running tests - Added wait time for services to be ready - Initialize WebDAV directories with correct permissions (nginx:nginx) - Enhanced debugging output to show nginx config and directory permissions - Test WebDAV operations (MKCOL) before running actual tests This should resolve the "MKCOL can create a collection only" errors by ensuring the WebDAV container is properly configured before tests run. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced non-existent ugeek/webdav:alpine-ng with bytemark/webdav - Updated health check to use pgrep apache2 instead of nginx - Updated initialization steps to match bytemark/webdav directory structure - Added AUTH_TYPE: Basic environment variable required by bytemark/webdav - Updated debugging commands to check Apache config instead of nginx This fixes the "manifest for ugeek/webdav:alpine-ng not found" error. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added ServerName localhost to Apache configuration to resolve FQDN warning - Added Apache restart after configuration change - Set hostname in Docker options to webdav-test for consistency - Added wait time after Apache restart to ensure service is ready - This fixes the "Could not reliably determine server's FQDN" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Changed health check from pgrep to test for apache2.pid file and process - Removed hostname setting that wasn't needed - Reduced health retries from 10 to 5 for faster feedback - Increased health start period to 45s to allow more time for Apache startup - Added separate WebDAV health verification step using curl from runner (not container) This avoids assuming curl is available inside the container while still providing proper health verification. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced bytemark/webdav (Apache-based) with dgraziotin/nginx-webdav - Nginx-based solution avoids Apache ServerName FQDN issues - Updated environment variables to WEBDAV_USERNAME/WEBDAV_PASSWORD - Simplified health check using pgrep nginx (no Apache restart needed) - Updated directory paths from /var/lib/dav/data/ to /webdav/ - Removed Apache-specific configuration and restart logic This should resolve the Apache startup and ServerName configuration issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.